﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mengsk.ProxyDelivery.Domain
{
    public class GoodsCount : IComparable<GoodsCount>
    {
        public string Market { get; set; }

        public string Address { get; set; }

        public string Vendor { get; set; }

        public string Number { get; set; }

        public int NumberId { get; set; }

        public string Edtion { get; set; }

        public string Color { get; set; }

        public string Size { get; set; }

        public double Money { get; set; }

        public int Count { get; set; }

        public int Area { get; set; }

        public int Street { get; set; }

        public int Door { get; set; }

        public DateTime PayTime { get; set; }

        public string OrderId { get; set; }

        public int CompareTo(GoodsCount other)
        {
            if (other == null)
            {
                return -1;
            }

            if (this.Area != other.Area)
            {
                return this.Area > other.Area ? 1 : -1;
            }

            if (this.Door != other.Door)
            {
                return this.Door > other.Door ? 1 : -1;
            }

            if (this.Street != other.Street)
            {
                return this.Street > other.Street ? 1 : -1;
            }

            if (this.Number != other.Number)
            {
                return this.Number.CompareTo(other.Number);
            }

            if (this.Edtion != other.Edtion)
            {
                return this.Edtion.CompareTo(other.Edtion);
            }

            if (this.Color != other.Color)
            {
                return this.Color.CompareTo(other.Color);
            }

            //最后排序，尺码
            return this.Size.CompareTo(other.Size);
        }
    }
}
